blob: 2b8fa45c0541b78e9d372b9c8b2dd6ccaf5bcbce [file] [log] [blame]
Nathanael Nerode748503c2002-10-01 22:34:161# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
Daniel Jacobowitz53dd8da2003-01-02 00:50:572# 1999, 2000, 2001, 2002, 2003 Free Software Foundation
Nathanael Nerode748503c2002-10-01 22:34:163#
4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17#
18
19# This Makefile contains release scripts for gdb, binutils, and other
20# packages which live in src. It used to be part of the top level Makefile,
21# but that turned out to be very messy and hard to maintain.
22
23# This stuff really ought to be cleaned up and turned into something other
24# than a Makefile. As it is it's heavily recursive.
25
26# This is the name of this script (!). Needed due to horrible recursion.
27SELF = src-release
28
29SHELL = /bin/sh
30
31BZIPPROG = bzip2
32MD5PROG = md5sum
33
34# pwd command to use. Allow user to override default by setting PWDCMD in
35# the environment to account for automounters. The make variable must not
36# be called PWDCMD, otherwise the value set here is passed to make
37# subprocesses and overrides the setting from the user's environment.
38PWD = $${PWDCMD-pwd}
39
40#
41# Support for building net releases
42
43# Files in devo used in any net release.
44# ChangeLog omitted because it may refer to files which are not in this
45# distribution (perhaps it would be better to include it anyway).
46DEVO_SUPPORT= README Makefile.in configure configure.in \
47config.guess config.if config.sub config move-if-change \
48mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
49COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
50mkinstalldirs ltconfig ltmain.sh missing ylwrap \
Daniel Jacobowitza26d7082003-05-02 17:29:4851libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \
52Makefile.def Makefile.tpl src-release
Nathanael Nerode748503c2002-10-01 22:34:1653
54# Files in devo/etc used in any net release.
55# ChangeLog omitted because it may refer to files which are not in this
56# distribution (perhaps it would be better to include it anyway).
57ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
58make-stds.texi standards.info* configure.texi configure.info* \
Daniel Jacobowitz53dd8da2003-01-02 00:50:5759configbuild.* configdev.* fdl.texi texi2pod.pl
Nathanael Nerode748503c2002-10-01 22:34:1660
61
62# When you use `make setup-dirs' or `make taz' you should always redefine
63# this macro.
64SUPPORT_FILES = list-of-support-files-for-tool-in-question
65
66# NOTE: No double quotes in the below. It is used within shell script
67# as VER="$(VER)"
68VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
69 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
70elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
71 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
72elif test -f $(TOOL)/version.in; then \
73 head -1 $(TOOL)/version.in; \
74elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
75 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
76else \
77 echo VERSION; \
78fi`
79PACKAGE = $(TOOL)
80
81.PHONY: taz
82taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
83$(MAKE) -f $(SELF) do-proto-toplev \
84TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
85MD5PROG="$(MD5PROG)" \
86SUPPORT_FILES="$(SUPPORT_FILES)"
87$(MAKE) -f $(SELF) do-md5sum \
88TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
89MD5PROG="$(MD5PROG)" \
90SUPPORT_FILES="$(SUPPORT_FILES)"
91$(MAKE) -f $(SELF) do-tar \
92TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
93MD5PROG="$(MD5PROG)" \
94SUPPORT_FILES="$(SUPPORT_FILES)"
95$(MAKE) -f $(SELF) do-bz2 \
96TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
97MD5PROG="$(MD5PROG)" \
98SUPPORT_FILES="$(SUPPORT_FILES)"
99
100.PHONY: gdb-tar
101gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
102$(MAKE) -f $(SELF) do-proto-toplev \
103TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
104MD5PROG="$(MD5PROG)" \
105SUPPORT_FILES="$(SUPPORT_FILES)"
106$(MAKE) -f $(SELF) do-md5sum \
107TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
108MD5PROG="$(MD5PROG)" \
109SUPPORT_FILES="$(SUPPORT_FILES)"
110$(MAKE) -f $(SELF) do-djunpack \
111TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
112MD5PROG="$(MD5PROG)" \
113SUPPORT_FILES="$(SUPPORT_FILES)"
114$(MAKE) -f $(SELF) do-tar \
115TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
116MD5PROG="$(MD5PROG)" \
117SUPPORT_FILES="$(SUPPORT_FILES)"
118
119.PHONY: gdb-taz
120gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
121$(MAKE) -f $(SELF) gdb-tar \
122TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
123MD5PROG="$(MD5PROG)" \
124SUPPORT_FILES="$(SUPPORT_FILES)"
125$(MAKE) -f $(SELF) do-bz2 \
126TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
127MD5PROG="$(MD5PROG)" \
128SUPPORT_FILES="$(SUPPORT_FILES)"
129
130.PHONY: do-proto-toplev
131do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
132echo "==> Making $(PACKAGE)-$(VER)/"
133# Take out texinfo from a few places.
134sed -e '/^all\.normal: /s/\all-texinfo //' \
135 -e '/^ install-texinfo /d' \
136<Makefile.in >tmp
137mv -f tmp Makefile.in
138#
139./configure sun4
Nathanael Nerodeb4fa0932002-12-05 22:43:12140$(MAKE) configure-host configure-target \
Nathanael Nerode748503c2002-10-01 22:34:16141 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
142 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
143# Make links, and run "make diststuff" or "make info" when needed.
144rm -rf proto-toplev ; mkdir proto-toplev
145set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
146for d in $$dirs ; do \
147 if [ -d $$d ]; then \
148 if [ ! -f $$d/Makefile ] ; then true ; \
149 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
150(cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
151 elif grep '^info:' $$d/Makefile >/dev/null ; then \
152 (cd $$d ; $(MAKE) info ) || exit 1 ; \
153 fi ; \
154 if [ -d $$d/proto-$$d.dir ]; then \
155 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
156 else \
157 ln -s ../$$d proto-toplev/$$d ; \
158 fi ; \
159 else ln -s ../$$d proto-toplev/$$d ; fi ; \
160done
161cd etc && $(MAKE) info
162$(MAKE) distclean
163#
164mkdir proto-toplev/etc
165(cd proto-toplev/etc; \
166 for i in $(ETC_SUPPORT); do \
167ln -s ../../etc/$$i . ; \
168 done)
169#
170# Take out texinfo from configurable dirs
171rm proto-toplev/configure.in
172sed -e '/^host_tools=/s/texinfo //' \
173 <configure.in >proto-toplev/configure.in
174#
175mkdir proto-toplev/texinfo
176ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
177if test -r texinfo/util/tex3patch ; then \
178 mkdir proto-toplev/texinfo/util && \
179 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
180else true; fi
181chmod -R og=u . || chmod og=u `find . -print`
182#
183# Create .gmo files from .po files.
184for f in `find . -name '*.po' -type f -print`; do \
185 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
186done
187#
188-rm -f $(PACKAGE)-$(VER)
189ln -s proto-toplev $(PACKAGE)-$(VER)
190
191.PHONY: do-tar
192do-tar:
193echo "==> Making $(PACKAGE)-$(VER).tar"
194-rm -f $(PACKAGE)-$(VER).tar
195find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
196| tar cTfh - $(PACKAGE)-$(VER).tar
197
198.PHONY: do-bz2
199do-bz2:
200echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
201-rm -f $(PACKAGE)-$(VER).tar.bz2
202$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
203
204.PHONY: do-md5sum
205do-md5sum:
206echo "==> Adding md5 checksum to top-level directory"
207cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
208| xargs $(MD5PROG) > ../md5.sum
209mv md5.sum proto-toplev
210
211.PHONY: do-djunpack
212do-djunpack:
213echo "==> Adding updated djunpack.bat to top-level directory"
214echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
215sed < djunpack.bat > djunpack.new \
216-e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
217mv djunpack.new djunpack.bat
218-rm -f proto-toplev/djunpack.bat
219ln -s ../djunpack.bat proto-toplev/djunpack.bat
220
221TEXINFO_SUPPORT= texinfo/texinfo.tex
222DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
223
224.PHONY: gas.tar.bz2
225GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
226gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
227$(MAKE) -f $(SELF) taz TOOL=gas \
228MD5PROG="$(MD5PROG)" \
229SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
230
231# The FSF "binutils" release includes gprof and ld.
232.PHONY: binutils.tar.bz2
Nathanael Nerode7aa673e2002-10-01 22:58:14233BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
Nathanael Nerode748503c2002-10-01 22:34:16234binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
235$(MAKE) -f $(SELF) taz TOOL=binutils \
236MD5PROG="$(MD5PROG)" \
237SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
238
239.PHONY: gas+binutils.tar.bz2
240GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
241gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
242$(MAKE) -f $(SELF) taz TOOL=gas \
243MD5PROG="$(MD5PROG)" \
244SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
245
246GNATS_SUPPORT_DIRS=include libiberty send-pr
247gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
248$(MAKE) -f $(SELF) taz TOOL=gnats \
249MD5PROG="$(MD5PROG)" \
250SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
251
252.PHONY: gdb.tar.bz2
253GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
254gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
255$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
256MD5PROG="$(MD5PROG)" \
257SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
258.PHONY: gdb.tar
259gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
260$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
261MD5PROG="$(MD5PROG)" \
262SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
263
264DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
265.PHONY: dejagnu.tar.bz2
266dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
267$(MAKE) -f $(SELF) taz TOOL=dejagnu \
268MD5PROG="$(MD5PROG)" \
269SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
270
271.PHONY: gdb+dejagnu.tar.bz2
272GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
273gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
274$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
275MD5PROG="$(MD5PROG)" \
276SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
277.PHONY: gdb+dejagnu.tar
278gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
279$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
280MD5PROG="$(MD5PROG)" \
281SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
282
283.PHONY: insight.tar.bz2
284INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
285insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
286$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
287MD5PROG="$(MD5PROG)" \
288SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
289.PHONY: insight.tar
290insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
291$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
292MD5PROG="$(MD5PROG)" \
293SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
294
295.PHONY: insight+dejagnu.tar.bz2
296INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
297insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
298$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
299MD5PROG="$(MD5PROG)" \
300SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
301.PHONY: insight+dejagnu.tar
302insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
303$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
304MD5PROG="$(MD5PROG)" \
305SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
306
307.PHONY: newlib.tar.bz2
308NEWLIB_SUPPORT_DIRS=libgloss
309# taz configures for the sun4 target which won't configure newlib.
310# We need newlib configured so that the .info files are made.
311# Unfortunately, it is not enough to just configure newlib separately:
312# taz will build the .info files but since SUBDIRS won't contain newlib,
313# distclean won't be run (leaving Makefile, config.status, and the tmp files
314# used in building the .info files, eg: *.def, *.ref).
315# The problem isn't solvable however without a lot of extra work because
316# target libraries are built in subdir $(target_alias) which gets nuked during
317# the make distclean. For now punt on the issue of shipping newlib info files
318# with newlib net releases and wait for a day when some native target (sun4?)
319# supports newlib (if only minimally).
320newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
321$(MAKE) -f $(SELF) taz TOOL=newlib \
322MD5PROG="$(MD5PROG)" \
323SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
324DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
325
326.NOEXPORT:
327MAKEOVERRIDES=